package com.pay.ioopos.support.serialport.custom;

import com.pay.ioopos.AppUtils;

/**
 * 指令消费：键盘操作
 * @author moyq5
 * @since 2022/8/3
 */
public class SerialPortPayCmd4KeyEventCer implements SerialPortPayCmdConsumer {

    @Override
    public void consume(byte[] data) {
        SerialPortPayCmd4KeyEvent keyboard  = (SerialPortPayCmd4KeyEvent)SerialPortPayCmdType.KEY_EVENT.deserialize(data);
        if (null == keyboard) {
            return;
        }
        AppUtils.dispatchKeyEvent(keyboard.getEvent());
    }

}
